cea3bb16493ca95d11fa6bbc1f65089df6fc882b,processor/src/main/java/org/derive4j/processor/GettersDerivator.java,GettersDerivator,generateLensGetter,#DataArgument#AlgebraicDataType#,131

Before Change


                (visitorParam, visitorType, constructors) -> visitorDispatchLensGetterImpl(adt, arg, visitorType, field))
            .functionsDispatch(constructors -> functionsDispatchLensGetterImpl(adt, arg, field)))
        .oneConstructor(constructor -> functionsDispatchLensGetterImpl(adt, arg, field))
        .noConstructor(DerivedCodeSpec::none)
        .apply(adt.dataConstruction());
  }

  private DerivedCodeSpec visitorDispatchLensGetterImpl(AlgebraicDataType adt, String arg, DeclaredType visitorType,

After Change



    String arg = asParameterName(adt);

    return caseOf(adt.dataConstruction())
        .multipleConstructors(MultipleConstructorsSupport.cases()
            .visitorDispatch(
                (visitorParam, visitorType, constructors) -> visitorDispatchLensGetterImpl(adt, arg, visitorType, field))
            .functionsDispatch(constructors -> functionsDispatchLensGetterImpl(adt, arg, field)))
        .oneConstructor(constructor -> functionsDispatchLensGetterImpl(adt, arg, field))
        .noConstructor(DerivedCodeSpec::none);
  }

  private DerivedCodeSpec visitorDispatchLensGetterImpl(AlgebraicDataType adt, String arg, DeclaredType visitorType,